#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableUnionBanquetGoodsDao:DaoBase<TableUnionBanquetGoods>
    {
        public override string GetFileName()
        {
            return "TableUnionBanquetGoods.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableUnionBanquetGoods>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableUnionBanquetGoods model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.goodsId)) UnityEngine.Debug.LogError("数据表id重复:TableUnionBanquetGoods->id: " + model.goodsId);
            #endif
            cachePrimaryInt[model.goodsId] = model;
        }
        protected override TableUnionBanquetGoods ParseRowData(string[] rowData)
        {
            TableUnionBanquetGoods data = new TableUnionBanquetGoods();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.goodsId = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.goodsName = string.Intern(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.pushGoodsType = int.Parse(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.buyCost = string.Intern(rowData[3]);
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.ownReward = string.Intern(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.icon = rowData[5];
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.musicResource = rowData[6];
            }
            return data;
        }
    }
}
